# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=mboxgrep
pkgver=0.7.9
pkgrel=5
pkgdesc='A small, non-interactive utility that scans mail folders for messages matching regular expressions. It does matching against basic and extended POSIX regular expressions, and reads and writes a variety of mailbox formats.'
url='http://mboxgrep.sourceforge.net/'
groups=('blackarch' 'blackarch-forensic')
license=('GPL')
depends=('pcre' 'bzip2' 'zlib')
arch=('x86_64' 'aarch64')
source=("http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz")
sha512sums=('d7e768a0ad11bc3df8619f2a888d2943c68ef72dd036c2fe58268686efb50cb1f62ba379571b6cd6efa8493c5ea0d7c09a29520eae6c68f66d9453710eeeba11')

build() {
  cd "$pkgname-$pkgver"

  ./configure --prefix=/usr --mandir="$pkgdir/usr/share/man" \
    --infodir="$pkgdir/usr/share/info"

  make
}
package(){
  cd "$pkgname-$pkgver/src"

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  cp -aR $pkgname "$pkgdir/usr/share/$pkgname/"

  ln -s "/usr/share/$pkgname/$pkgname" "$pkgdir/usr/bin/"
}

